using PureMVC.Interfaces;
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class SttleBagCommand : PureMVC.Patterns.SimpleCommand
{
    public override void Execute(INotification notification)
    {
        base.Execute(notification);
        BagDataProxy bagDataProxy = MyFacade.Instance.RetrieveProxy(BagDataProxy.NAME) as BagDataProxy;
        bagDataProxy.bagModels.Sort(Func);
    }

    private int Func(BagModel x, BagModel y)
    {
        if (x.Num > y.Num)
        {
            return -1;
        }
        else if(x.Num==y.Num)
        {
            return 0;
        }
        else
        {
            return 1;
        }
    }
}
